fix(tests): keep VCR cassette open during setup_and_teardown teardown#583
Closed
michael-richey wants to merge 1 commit into
Closed
fix(tests): keep VCR cassette open during setup_and_teardown teardown#583michael-richey wants to merge 1 commit into
michael-richey wants to merge 1 commit into
Conversation
Declare vcr as an explicit fixture parameter so pytest finalises it after setup_and_teardown, not before. Without the dependency the teardown phase could run after the cassette was closed, causing real aiohttp calls that time out (30 s) in CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Closing — exploring a non-VCR approach to fix the teardown failure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setup_and_teardown(class autouse) andvcr(plugin autouse) had no explicit dependency, so pytest could finalizevcrfirst — closing the cassette and unpatchingaiohttpbefore the teardown phase ran.TimeoutError while getting resources users).vcras an explicit parameter tosetup_and_teardown, which guarantees pytest keeps the cassette open until after teardown completes.Test plan
TestNotebooksResources.test_resource_importteardown — the test that was failing with a 30 s timeout in feat(notebooks): lightweight LIST + per-id GET #567's CI run)BaseResourcesTestClass)🤖 Generated with Claude Code